package com.ruoyi.personnel.oa.approve.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.sql.Timestamp;
import java.util.List;

/**
 * 审批实体类
 * 对应数据库字段 oa_approve
 * @author lsy 2021.9.6
 * 修改：
 */
@Data
@NoArgsConstructor
public class ApproveDomain {
    /**
     * 主键
     */
    @ApiModelProperty(value = "主键", required = true)
    private long approveId;

    /**
     * 关联编号
     */
    @NotNull(message = "关联编号不能为空")
    @ApiModelProperty(value = "关联编号", required = true)
    private String associationId;

    /**
     * 审批事项
     */
    @NotNull(message = "审批事项不能为空")
    @ApiModelProperty(value = "审批事项", required = true)
    private String approveTitle;

    /**
     * 类别
     * 0-会议申请
     * 1-采购
     * 2-入库
     */
    @NotNull(message = "类别不能为空")
    @ApiModelProperty(value = "类别", required = true)
    private String approveType;

    /**
     * 申请人编号
     */
    @NotNull(message = "申请人编号不能为空")
    @ApiModelProperty(value = "申请人编号", required = true)
    private String applicantId;

    /**
     * 申请时间
     */
    @ApiModelProperty("申请时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Timestamp applicantTime;

    /**
     * 审批状态
     * 0-审批中 1-审批未通过 2-审批通过 3-未完成 4-审批完成
     */
    @ApiModelProperty(value = "状态")
    private String approveStatus;

    /**
     * 当前审核人
     */
    @ApiModelProperty(value = "当前审核人")
    private long currentApprover;

    /**
     * 审批记录
     */
    @ApiModelProperty(value = "审批记录")
    private List<ApproveRecord> approveRecords;

    public ApproveDomain(String associationId ,String approveTitle, String approveType) {
        this.associationId = associationId;
        this.approveTitle = approveTitle;
        this.approveType = approveType;
    }

    public ApproveDomain(String associationId ,String approveTitle, String approveType, String applicantId) {
        this.associationId = associationId;
        this.approveTitle = approveTitle;
        this.approveType = approveType;
        this.applicantId = applicantId;
    }
}
